<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="../common.jsp" %>
<jsp:include page="safea.jsp"/>
<%@ include file="../GlobalVar.jsp" %>
<html>
    <head>
        <title>网上图书超市</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link href="../CSS/style.css" rel="stylesheet">

    </head>

    <script language="javascript">
        function mycheck(){
            if (form1.Isbn.value==""){
                alert("请输入书号！");form1.Isbn.focus();return;
            }
            if (form1.mc.value==""){
                alert("请输入图书名称！");form1.mc.focus();return;
            }
            if (form1.auther.value==""){
                alert("请输入作者！");form1.auther.focus();return;
            }
            if (form1.Lxbm.value==""){
                alert("请输入类别！");form1.Lxbm.focus();return;
            }
            if (form1.publisher.value==""){
                alert("请输入出版社！");form1.publisher.focus();return;
            }
            if (form1.pubDate.value==""){
                alert("请输入发行日期！");form1.pupDate.focus();return;
            }
            if (form1.price.value==""){
                alert("请输入定价！");form1.price.focus();return;
            }
            if (isNaN(form1.price.value)){
                alert("您输入的定价错误，请重新输入！");form1.price.value="";form1.price.focus();return;
            }
            form1.submit();
        }
    </script>
    <c:if test="${param.submitted!=null}">

        <jsp:setProperty name="book" property="*"/>
        <c:choose>
            <c:when test="${book.update==true}">
                <c:out value="<script language='javascript'>alert('图书信息添加成功！');</script>" escapeXml="false"></c:out>
                <c:redirect url="index.jsp"></c:redirect>
            </c:when>
            <c:otherwise>
                <c:out value="<script language='javascript'>alert('图书信息添加失败！');</script>" escapeXml="false"></c:out>
            </c:otherwise>
        </c:choose>
    </c:if>
    <body>
        <table width="100%"  border="0" cellspacing="0" cellpadding="0" background="../Images/bg.gif">
            <tr>
                <td>
                    <table width="777" height="609"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                        <tr>
                            <td valign="top">
                                <jsp:include page="Top.jsp"/>
                                <table width="100%"  border="0" cellspacing="0" cellpadding="0" class="tableBorder_LTR">
                                    <tr>
                                        <td height="30" align="center" bgcolor="#eeeeee">≡≡≡ <a href="index.jsp">图书管理</a> ≡≡≡</td>
                                    </tr>
                                </table>
                                <table width="100%" height="396"  border="0" cellpadding="0" cellspacing="0" class="tableBorder_LBR">
                                    <tr>
                                        <td width="26%" height="395" valign="top"><table width="100%"  border="0" cellspacing="-2" cellpadding="-2">
                                                <tr>
                                                    <td width="55%" height="82" align="center" class="word_grey">&nbsp;<img src="../Images/reg.gif" width="84" height="54"></td>
                                                    <td width="45%" align="left" class="word_grey">修改图书信息</td>
                                                </tr>
                                                <tr>
                                                    <td height="112" colspan="2" valign="top" class="word_grey"><ul>
                                                            <li> 书号：图书的ISBN，请务必输入正确，此项不能修改。</li>
                                                            <li>发行日期：请输入该书首次发行的日期，如2005年10月。</li>
                                                            <li>封面文件：请先将图书的封面文件保存到站点的manage\cover文件夹下，再输入文件名即可，包括扩展名，如：JSPxxxtkfaljx.jpg。</li>

                                                    </ul></td>
                                                </tr>
                                                <tr align="center">
                                                    <td colspan="2" valign="middle" class="word_grey"></td>
                                                </tr>
                                        </table></td>
                                        <td width="5" valign="top" background="../Images/Cen_separate.gif"></td>
                                        <td width="73%" valign="top"><table width="100%" height="56"  border="0" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td align="center">&nbsp;</td>
                                                </tr>
                                                <c:if test="${param.bookId!=null}">
                                                    <jsp:setProperty name="book" property="id" value="${param.bookId}" />
                                                    <c:forEach var="current" items="${book.dateByid}">
                                                        <tr>
                                                            <td align="center">
                                                                <form action="book_modify.jsp" method="post" name="form1">
                                                                    <table width="100%"  border="0" align="center" cellpadding="-2" cellspacing="-2" bordercolordark="#FFFFFF">
                                                                        <tr>
                                                                            <td width="14%" height="27">书　号：</td>
                                                                            <td height="27">&nbsp;
                                                                            <input name="bm" type="hidden" class="Sytle_text" value="<c:out value="${current.bm}" escapeXml="false"></c:out>">
                                                                            <input name="isbn" type="text" class="Sytle_text" value="<c:out value="${current.isbn}" escapeXml="false"></c:out>"></td>
                                                                            <td height="27">书　名：</td>
                                                                            <td height="27">&nbsp;
                                                                            <input name="mc" type="text" class="Style_upload" value="<c:out value="${current.mc}" escapeXml="false"></c:out>">                    </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td height="27">作　者：</td>
                                                                            <td width="25%" height="27">&nbsp;
                                                                            <input name="author" type="text" class="Style_upload" value="<c:out value="${current.author}" escapeXml="false"></c:out>">                    </td>
                                                                            <td width="15%" height="27"> &nbsp;类别名称：</td>
                                                                            <td width="46%" height="27">&nbsp;
                                                                                <input name="lxbm" type="text" class="Sytle_text" value="<c:out value="${current.lxbm}" escapeXml="false"></c:out>">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td height="27">出&nbsp;版&nbsp;社：</td>
                                                                            <td height="27">&nbsp;
                                                                            <input name="publisher" type="text" class="Style_upload" value="<c:out value="${current.publisher}" escapeXml="false"></c:out>">                    </td>
                                                                            <td height="27">发行日期：</td>
                                                                            <td height="27">&nbsp;
                                                                            <input name="pubDate" type="text" class="Sytle_text" value="<c:out value="${current.pubDate}" escapeXml="false"></c:out>">                   </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td height="41">封面文件：</td>
                                                                            <td height="41">&nbsp;
                                                                            <input name="picPath" type="text" class="Style_upload" value="<c:out value="${current.picPath}" escapeXml="false"></c:out>">                    </td>
                                                                            <td height="41">价　格：</td>
                                                                            <td height="41">&nbsp;
                                                                                <input name="price" type="text" class="Sytle_text" value="<c:out value="${current.price}" escapeXml="false"></c:out>">
                                                                            (元)</td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td height="41">页数：</td>
                                                                            <td height="41">&nbsp;
                                                                            <input name="ym" type="text" class="Style_upload" value="<c:out value="${current.ym}" escapeXml="false"></c:out>">                    </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <input name="submitted" type="hidden" class="Style_upload" value="true">

                                                                            <td height="103">图书简介：</td>
                                                                            <td colspan="3"><span class="style5">&nbsp; </span>
                                                                            <input name="content" cols="60" rows="5" class="Style_upload" value="<c:out value="${current.content}" escapeXml="false"></c:out>"></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td height="38" colspan="4" align="center">
                                                                                <input name="Button" type="submit" class="btn_grey" value="保存">
                                                                                &nbsp;
                                                                                <input name="Submit2" type="reset" class="btn_grey" value="重置">
                                                                                &nbsp;
                                                                            <input name="Submit3" type="button" class="btn_grey" value="返回" onClick="JScript:history.back()">                    </td>
                                                                        </tr>
                                                                    </table>
                                                                </form>
                                                            </td>
                                                        </tr>
                                                </table></td>
                                            </tr>
                                        </table>
                                    </c:forEach>
                                </c:if>
                                <jsp:include page="copyright.jsp"/>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </body>
</html>